import 'dart:ui';

// 字串转颜色
class HexColor extends Color {
  HexColor(String hex) : super(_parseHex(hex));
  static int _parseHex(String hex) {
    hex = hex.toUpperCase().replaceAll('#', '');
    if (hex.length == 6) hex = 'FF$hex';
    return int.parse(hex, radix: 16);
  }
}